// Copyright (c) 2005  INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of cgal-python; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with cgal-python.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $Id: Py_Line_3.cpp 167 2007-11-02 15:36:54Z spion $
// $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal-python/trunk/cgal-python/bindings/Kernel/Py_Line_3.cpp $
//
// Author(s)     : Naceur Meskini and Sylvain Pion
//=========================================================================

#include <CGAL/basic.h>
#include <include/Kernels.h>

#include <boost/python.hpp>
#include <boost/cstdint.hpp>

const char* Line_3_doc[] ={
"An object l of the data type Line_3 is a directed straight line in the three-dimensional Euclidean space\n\n\
For more details see a C++ doc:\n\
http://www.cgal.org/Manual/3.2/doc_html/cgal_manual/Kernel_23_ref/Class_Line_3.html",

"\
l = Line_3( Point_3 p, Point_3 q)\n\
introduces a line l passing through the points p and q. \n\
Line l is directed from p to q.\n\n\
l = Line_3( Point_3 p, Direction_3 d)\n\
introduces a line l passing through point p with direction d.\n\n\
l = Line_3( Point_3 p, Vector_3 v)\n\
introduces a line l passing through point p and oriented by v.\n\n\
l = Line_3( Segment_3 s)\n\
returns the line supporting the segment s, oriented from source to target.\n\n\
l = Line_3( Ray_3 r)\n\
returns the line supporting the ray r, with the same orientation.",

"l.perpendicular_plane(self, Point_3 p) -> Plane_3\nreturns the plane perpendicular to l passing through p.",

"l.opposite(self) -> Line_3\nreturns the line with opposite direction.", 

"l.point(self,int i) -> Point_3\nreturns an arbitrary point on l. It holds point(i) = point(j), iff i=j.", 

"l.to_vector(self) -> Vector_3\nreturns a vector having the same direction as l.",

"l.direction(self) -> Direction_3\nreturns the direction of l.",

"l.projection(self,Point_3 p) -> Point_3\nreturns the orthogonal projection of p on l.",

"l.has_on(self,Point_3 p) -> bool\nreturns true iff p lies on l. ", 

"l.is_degenerate(self) -> bool\nreturns true iff line l is degenerated to a point.",

"l.transform(self,Aff_transformation_3 t) -> Line_3\nreturns the line obtained by applying t on a point on l and the direction of l."
};

template <class kernel > 
void Py_Line_3()
{
	using namespace boost::python;
	typedef typename kernel::Point_3 			Point_3;
	typedef typename kernel::Segment_3 			Segment_3;
 	typedef typename kernel::Vector_3 			Vector_3;
 	typedef typename kernel::Direction_3 			Direction_3;
	typedef typename kernel::Line_3 			Line_3;
	typedef typename kernel::Ray_3 			        Ray_3;

        class_< Line_3 >("Line_3",Line_3_doc[0],init<>())
	.def(init< const Line_3& >(Line_3_doc[1]))
	.def(init< const Point_3&, const Point_3& >())
	.def(init< const Segment_3& >())
	.def(init< const Ray_3& >())
	.def(init< const Point_3&, const Vector_3& >())
	.def(init< const Point_3&, const Direction_3& >())
	.def("perpendicular_plane", &Line_3::perpendicular_plane, Line_3_doc[2])
	.def("opposite", &Line_3::opposite, Line_3_doc[3])
	.def("point", (Point_3 (Line_3::*)(int) const)&Line_3::point, Line_3_doc[4])
	.def("to_vector", &Line_3::to_vector, BEF_33(by_cref, by_copy)(), Line_3_doc[5])
	.def("direction", &Line_3::direction, Line_3_doc[6])
	.def("projection", &Line_3::projection, Line_3_doc[7])
	.def("has_on", &Line_3::has_on, Line_3_doc[8])
	.def("is_degenerate", &Line_3::is_degenerate, Line_3_doc[9])
	.def("transform", &Line_3::transform, Line_3_doc[10])
	.def( self == self )
	.def( self != self )
        ;
}


void export_Line_3()
{
	Py_Line_3<K>();
}
